home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / a_man / cat1 / symmon.z / symmon
Encoding:
Text File  |  1998-10-20  |  16.5 KB  |  397 lines

  1.  
  2.  
  3.  
  4. ssssyyyymmmmmmmmoooonnnn((((1111MMMM))))                                                          ssssyyyymmmmmmmmoooonnnn((((1111MMMM))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      symmon - kernel symbolic debugger
  10.  
  11. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  12.      _s_y_m_m_o_n is a standalone program used to debug the kernel.  It is intended
  13.      to be used only by those involved in writing and debugging device drivers
  14.      or other parts of the kernel.  The implementation of _s_y_m_m_o_n is machine
  15.      dependent and the commands and functionality described here may not apply
  16.      to all systems.
  17.  
  18.      To use _s_y_m_m_o_n, several steps must be taken to prepare the system:
  19.  
  20.      1.  _s_y_m_m_o_n must be manually installed by the user, because it is not
  21.          installed on the system as shipped from the factory.  This can be
  22.          done by installing the ``Debugging Kernels'' subsystem in the IDO
  23.          software development option.
  24.  
  25.      2.  Alterations must be done to the file /_v_a_r/_s_y_s_g_e_n/_s_y_s_t_e_m/_i_r_i_x._s_m to
  26.          build a kernel capable of being debugged; see the comments in that
  27.          file for details.
  28.  
  29.      3.  The program _s_e_t_s_y_m(1M) needs to be run on the newly generated kernel
  30.          to allow _s_y_m_m_o_n to recognize symbols in it.
  31.  
  32.      4.  _s_y_m_m_o_n needs to be installed in the volume header of the root drive
  33.          with _d_v_h_t_o_o_l(1M).  This normally happens as part of the software
  34.          installation process.
  35.  
  36.      _s_y_m_m_o_n is typically used with a terminal as the system console (see
  37.      _p_r_o_m(1M) for information on how to enable a terminal as the console).
  38.      When a debug kernel is booted, it automatically tries to load _s_y_m_m_o_n from
  39.      the same source.  _s_y_m_m_o_n can be booted from an alternate device by
  40.      setting the ddddbbbbggggnnnnaaaammmmeeee environment variable in the prom.  For example:
  41.  
  42.           _ssss_eeee_tttt_eeee_nnnn_vvvv _dddd_bbbb_gggg_nnnn_aaaa_mmmm_eeee _ssss_cccc_ssss_iiii_((((_1111_))))_dddd_iiii_ssss_kkkk_((((_1111_))))_rrrr_dddd_iiii_ssss_kkkk_((((_0000_))))_pppp_aaaa_rrrr_tttt_iiii_tttt_iiii_oooo_nnnn_((((_8888_))))_ssss_yyyy_mmmm_mmmm_oooo_nnnn
  43.  
  44.      loads _s_y_m_m_o_n from a disk 1, connected to SCSI controller 1.
  45.  
  46.      Once _s_y_m_m_o_n is loaded, the system operates normally until _s_y_m_m_o_n is
  47.      triggered by the keyboard or an exceptional condition happens in the
  48.      kernel that causes it to enter the debugger automatically.  To enter
  49.      _s_y_m_m_o_n from the keyboard, type a <Ctrl-a>.  _s_y_m_m_o_n prompts with DDDDBBBBGGGG:::: and
  50.      accepts commands described below.
  51.  
  52.    BBBBuuuuiiiilllltttt----iiiinnnn CCCCoooommmmmmmmaaaannnnddddssss
  53.      _s_y_m_m_o_n has a set of basic commands for setting and clearing breakpoints
  54.      and examining system state.  Not all of the commands listed below are
  55.      supported on all systems.  Some commands take memory addresses as
  56.      arguments.  Addresses can be given directly in decimal, in hex if
  57.      preceded by 0000xxxx, in binary if preceded with 0000bbbb, as names of functions or
  58.      data, as names of registers if preceded by $$$$, or as a combination of
  59.      those with ++++ and ----.  Some commands take a range of addresses specified as
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. ssssyyyymmmmmmmmoooonnnn((((1111MMMM))))                                                          ssssyyyymmmmmmmmoooonnnn((((1111MMMM))))
  71.  
  72.  
  73.  
  74.      either _A_D_D_R::::_A_D_D_R for an inclusive range or _A_D_D_R####_C_O_U_N_T for a count of
  75.      _C_O_U_N_T starting at _A_D_D_R.  Commands are listed below:
  76.  
  77.      bbbbrrrrkkkk [_A_D_D_R]
  78.           Set a breakpoint at the given address.  If no arguments are given,
  79.           the set of current breakpoints is listed.
  80.  
  81.      bbbbtttt [_M_A_X__F_R_M]
  82.           Print a stack back trace of up to _M_A_X__F_R_M frames.  See the
  83.           discussion about uuuubbbbtttt below for an alternate form of stack back
  84.           trace.
  85.  
  86.      cccc    Continue execution from a breakpoint.
  87.  
  88.      ccccaaaacccchhhheeeefffflllluuuusssshhhh [_R_A_N_G_E]
  89.           Flush both the instruction and data caches over the range of address
  90.           given.
  91.  
  92.      ccccaaaallllcccc
  93.      ccccaaaallllllll _A_D_D_R [_A_R_G_L_I_S_T]
  94.           Set up a stack frame and call the procedure at the specified
  95.           address.
  96.  
  97.      cccclllleeeeaaaarrrr
  98.           Clear the screen.
  99.  
  100.      ddddiiiissss [_R_A_N_G_E]
  101.           Disassemble instructions in memory over the range specified.
  102.  
  103.      dddduuuummmmpppp [----bbbb|----hhhh|----wwww|----dddd] [----oooo|----tttt|----xxxx|----cccc] _R_A_N_G_E
  104.           Dump the contents of memory.  The ----bbbb, ----hhhh, ----wwww and ----dddd flags can be
  105.           used to specify byte, halfword, word or double word data.  The ----oooo,
  106.           ----tttt, ----xxxx, and ----cccc flags can be used to specify octal, decimal,
  107.           hexadecimal, or ASCII data formats.
  108.  
  109.           The specified range of memory to dump can take these forms:
  110.  
  111.           +o  _b_a_s_e for a single location
  112.  
  113.           +o  _b_a_s_e####_c_o_u_n_t for _c_o_u_n_t locations starting at _b_a_s_e
  114.  
  115.           +o  _b_a_s_e::::_l_i_m_i_t for locations whose addresses are greater than or
  116.              equal to _b_a_s_e but less than _l_i_m_i_t
  117.  
  118.      gggg [----bbbb|----hhhh|----wwww] [_A_D_D_R|$_r_e_g_n_a_m_e]
  119.           Get and display the contents of memory at the address given.  If a
  120.           register name is given, its contents are displayed at the time the
  121.           kernel was stopped.
  122.  
  123.      ggggoooottttoooo _A_D_D_R
  124.           Continue execution until the given address or a breakpoint is
  125.           reached.  This is a short hand way to set a breakpoint at an
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. ssssyyyymmmmmmmmoooonnnn((((1111MMMM))))                                                          ssssyyyymmmmmmmmoooonnnn((((1111MMMM))))
  137.  
  138.  
  139.  
  140.           address, continue, and then remove that breakpoint.
  141.  
  142.      hhhheeeellllpppp List a short summary of the built-in commands.
  143.  
  144.      hhhhxxxx _N_A_M_E
  145.           The symbol table is searched for entries matching _N_A_M_E, and if one
  146.           is found, its value is printed.
  147.  
  148.      kkkkpppp [_K_P_N_A_M_E]
  149.           Kernel print command.  If no arguments are given, a list of the
  150.           available kernel print commands is given.  If a name is given, that
  151.           print function is executed.  See the discussion on kernel print
  152.           commands below for more information.
  153.  
  154.      llllkkkkaaaaddddddddrrrr _A_D_D_R
  155.           The given address is matched against the symbol table and the
  156.           symbols near it are listed.
  157.  
  158.      llllkkkkuuuupppp _S_T_R_I_N_G
  159.           The given string is matched against the symbol table and any symbol
  160.           with an equal or longer name is printed.  This is convenient when
  161.           you cannot remember the precise symbol name.
  162.  
  163.      mmmmssssyyyymmmmssss _I_D
  164.           Print dynamically loaded kernel module's symbols.  The module id is
  165.           found using either the _l_b_o_o_t ----VVVV command or the _m_l lllliiiisssstttt command.  See
  166.           the _m_l_o_a_d(4) manual page for more information.
  167.  
  168.      nnnnmmmm _A_D_D_R
  169.           The address given is matched against the symbol table and if an
  170.           exact match is found, the symbolic name is printed.  This is a more
  171.           restrictive version of the llllkkkkaaaaddddddddrrrr command described above.
  172.  
  173.      pppp [----bbbb|----hhhh|----wwww] _A_D_D_R _V_A_L_U_E
  174.           Put the value given into the address given.  This causes a write to
  175.           memory.
  176.  
  177.      pppprrrriiiinnnnttttrrrreeeeggggssss
  178.           List the contents of the general purpose registers when the kernel
  179.           was stopped.
  180.  
  181.      qqqquuuuiiiitttt Restart the PROM.
  182.  
  183.      ssss [_C_O_U_N_T]
  184.           Single step the kernel for either one instruction or the given
  185.           count.  If the current instruction is a branch, then both it and the
  186.           following instruction are executed.  The next unexecuted instruction
  187.           is disassembled when the command completes.  After a sssstttteeeepppp command is
  188.           issued, _s_y_m_m_o_n enters a command repeat mode where a null command
  189.           causes another step to be taken.  This repeat mode is indicated by a
  190.           change to the prompt.
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. ssssyyyymmmmmmmmoooonnnn((((1111MMMM))))                                                          ssssyyyymmmmmmmmoooonnnn((((1111MMMM))))
  203.  
  204.  
  205.  
  206.      SSSS [_C_O_U_N_T]
  207.           Same as the sssstttteeeepppp command above, except that jump-and-link
  208.           instructions are stepped over.
  209.  
  210.      ttttllllbbbbdddduuuummmmpppp [_R_A_N_G_E]
  211.           List the contents of the translation lookaside buffer.  If
  212.           specified, the range of TLB entries given is listed.  The range
  213.           should specify a subset of the 64 TLB slots.
  214.  
  215.      ttttllllbbbbfffflllluuuusssshhhh [_R_A_N_G_E]
  216.           Flush the TLB over the range of entries given or the entire TLB if
  217.           no range is specified.
  218.  
  219.      ttttllllbbbbmmmmaaaapppp [----iiii _I_N_D_E_X] [----nnnn|----dddd|----gggg|----vvvv] _V_A_D_D_R _P_A_D_D_R
  220.           Inserts an entry in the TLB that maps the virtual address given by
  221.           _V_A_D_D_R to the physical address given by _P_A_D_D_R.  If specified, the TLB
  222.           slot given by _I_N_D_E_X is used.  The ----nnnn, ----dddd, ----gggg, and ----vvvv flags can be
  223.           used to turn on the non-cached, dirty, global, and valid bits.  The
  224.           current TLB context number is used.
  225.  
  226.      ttttllllbbbbppppiiiidddd [_P_I_D]
  227.           Get or set the current TLB context number.  If no argument is given,
  228.           the current TLB context number is returned; otherwise, the context
  229.           number is set to the argument.
  230.  
  231.      ttttllllbbbbppppttttoooovvvv _P_A_D_D_R
  232.           Display TLB entries that map a virtual address to the physical
  233.           address given.
  234.  
  235.      ttttllllbbbbvvvvttttoooopppp _V_A_D_D_R [_P_I_D]
  236.           Find the physical address mapped to the virtual address given by
  237.           _V_A_D_D_R.  If _P_I_D is given, then it is used as the TLB context number
  238.           in the match; otherwise, the current TLB context number is used.
  239.  
  240.      uuuunnnnbbbbrrrrkkkk [_B_P_N_U_M]
  241.           Remove the breakpoint with the breakpoint number given.  The
  242.           breakpoint number can by determined by listing the set breakpoints
  243.           with the bbbbrrrrkkkk command.
  244.  
  245.      wwwwpppptttt [rrrr|wwww|rrrrwwww] [0000|_P_A_D_D_R]
  246.           Set a read, write or read/write watch point at on physical address
  247.           using the R4000 watch point registers.  The address must be double
  248.           word aligned, and the watch point trips on any access within the
  249.           next eight bytes.  An argument of 0 clears the watch point.  Note
  250.           that the R4000 only supports one watch point at a time.
  251.  
  252.      [_A_D_D_R]////[_C_O_U_N_T][dddd|DDDD|oooo|OOOO|xxxx|XXXX|XXXXXXXX|bbbb|ssss|cccc|iiii]
  253.           Dump the contents of memory at the given address.  This command
  254.           functions in a similar manner as the _d_b_x(1) command of the same
  255.           syntax.  The XXXXXXXX is a _s_y_m_m_o_n specific extension to printing
  256.           hexadecimal double words.
  257.  
  258.  
  259.  
  260.  
  261.                                                                         PPPPaaaaggggeeee 4444
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268. ssssyyyymmmmmmmmoooonnnn((((1111MMMM))))                                                          ssssyyyymmmmmmmmoooonnnn((((1111MMMM))))
  269.  
  270.  
  271.  
  272.    KKKKeeeerrrrnnnneeeellll PPPPrrrriiiinnnntttt CCCCoooommmmmmmmaaaannnnddddssss
  273.      The kernel extends the set of built-in _s_y_m_m_o_n commands with kernel print
  274.      commands.  These commands dump various kernel data structures.
  275.  
  276.      pppprrrroooocccc _P_R_O_C_I_N_D_E_X
  277.           Dump the process structure associated with the given process table
  278.           index.  Note that the process table index is not the same as the
  279.           IRIX process ID.
  280.  
  281.      uuuusssseeeerrrr _P_R_O_C_I_N_D_E_X
  282.           Dump the contents of the user structure for the process with the
  283.           process table index given.
  284.  
  285.      bbbbuuuuffff _B_U_F_N_U_M
  286.           Dump the contents of a buffer structure.  The address of the buffer
  287.           to be dumped is controlled by the BBBBUUUUFFFFNNNNUUUUMMMM argument.  If BBBBUUUUFFFFNNNNUUUUMMMM is a
  288.           valid K0, K1, or K2 address, then the buffer at that address is
  289.           displayed.  If BBBBUUUUFFFFNNNNUUUUMMMM is a small integer, it is used as an index
  290.           into the buffer table.  If BBBBUUUUFFFFNNNNUUUUMMMM is equal to -1, summary
  291.           information about the buffer pool is displayed.
  292.  
  293.      qqqqbbbbuuuuffff _D_E_V_I_C_E
  294.           Dump the contents of buffers queued for the device given.  The
  295.           device argument is given as the major/minor device number of the
  296.           desired device.
  297.  
  298.      ppppddddaaaa [_C_P_U_I_D]
  299.           Dump the contents of the processor private data area for the
  300.           processor ID given.
  301.  
  302.      rrrruuuunnnnqqqq Dump the run queue.  A short summary of each process waiting for CPU
  303.           time is listed.
  304.  
  305.      eeeeffffrrrraaaammmmeeee [_A_D_D_R]
  306.           The exception frame at the given address is displayed.  If the
  307.           address is a small integer, the exception frame of the process with
  308.           that process table index is used.  The exception frame holds the
  309.           contents of the general purpose registers at the time the process
  310.           last executed.
  311.  
  312.      uuuubbbbtttt [_P_R_O_C_I_N_D_E_X]
  313.           User process stack back trace.  A stack back trace is listed for the
  314.           process whose process table index is given.
  315.  
  316.      pppplllliiiisssstttt
  317.           Process table list.  This gives an output similar to _p_s(1) and can
  318.           be used to find the process table index number for a process.
  319.  
  320.      ppppbbbb   Dump console print buffer.  The contents of the console print buffer
  321.           are printed.  This can be useful when an important message has
  322.           scrolled off the screen.
  323.  
  324.  
  325.  
  326.  
  327.                                                                         PPPPaaaaggggeeee 5555
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334. ssssyyyymmmmmmmmoooonnnn((((1111MMMM))))                                                          ssssyyyymmmmmmmmoooonnnn((((1111MMMM))))
  335.  
  336.  
  337.  
  338. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  339.      prom(1M).
  340.  
  341.  
  342.  
  343.  
  344.  
  345.  
  346.  
  347.  
  348.  
  349.  
  350.  
  351.  
  352.  
  353.  
  354.  
  355.  
  356.  
  357.  
  358.  
  359.  
  360.  
  361.  
  362.  
  363.  
  364.  
  365.  
  366.  
  367.  
  368.  
  369.  
  370.  
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.                                                                         PPPPaaaaggggeeee 6666
  394.  
  395.  
  396.  
  397.